\(\mathcal{YiHsin}\;\mathcal{Lu}\)


【EX1】

We would like to realize which factors are related to the likelihood that a hospital patients acquires an infection while hospitalized. The variables here are y= infection risk, x1= average length of patient stay, x2= average patient age, x3= measure of how many x-rays are given in the hospital (Hospital Infection dataset).

(EX1) Data Set


(EX1) Least Square Estimation

\(\hat\beta = (\mathbb{X}'\mathbb{X})^{-1}\mathbb{X}'\mathbb{Y}\)


【EX2】

There are 214 females in statistics classes at the University of California at Davis (Stat Females dataset). The variables are y= student’s self-reported height, x1= student’s guess at her mother’s height, and x2= student’s guess at her father’s height. All heights are in inches.

(EX2) Data Set


(EX2) Least Square Estimation

  • \(\hat\beta = (\mathbb{X}'\mathbb{X})^{-1}\mathbb{X}'\mathbb{Y}\)

(EX2) Plot

  • Surface: \(\hat{y} = \hat\beta_{0}+\hat\beta_{1}x_1+\hat\beta_{2}x_2\)

  • Red points: \((x_1,x_2,y)\)